# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTextPromptDatasetMetadata do
  @moduledoc """
  The metadata of Datasets that contain Text Prompt data.

  ## Attributes

  *   `candidateCount` (*type:* `String.t`, *default:* `nil`) - Number of candidates.
  *   `gcsUri` (*type:* `String.t`, *default:* `nil`) - The Google Cloud Storage URI that stores the prompt data.
  *   `groundingConfig` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPredictParamsGroundingConfig.t`, *default:* `nil`) - Grounding checking configuration.
  *   `hasPromptVariable` (*type:* `boolean()`, *default:* `nil`) - Whether the prompt dataset has prompt variable.
  *   `logprobs` (*type:* `boolean()`, *default:* `nil`) - Whether or not the user has enabled logit probabilities in the model parameters.
  *   `maxOutputTokens` (*type:* `String.t`, *default:* `nil`) - Value of the maximum number of tokens generated set when the dataset was saved.
  *   `note` (*type:* `String.t`, *default:* `nil`) - User-created prompt note. Note size limit is 2KB.
  *   `promptApiSchema` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPromptApiSchema.t`, *default:* `nil`) - The API schema of the prompt to support both UI and SDK usages.
  *   `promptType` (*type:* `String.t`, *default:* `nil`) - Type of the prompt dataset.
  *   `seedEnabled` (*type:* `boolean()`, *default:* `nil`) - Seeding enables model to return a deterministic response on a best effort basis. Determinism isn't guaranteed. This field determines whether or not seeding is enabled.
  *   `seedValue` (*type:* `String.t`, *default:* `nil`) - The actual value of the seed.
  *   `stopSequences` (*type:* `list(String.t)`, *default:* `nil`) - Customized stop sequences.
  *   `systemInstruction` (*type:* `String.t`, *default:* `nil`) - The content of the prompt dataset system instruction.
  *   `systemInstructionGcsUri` (*type:* `String.t`, *default:* `nil`) - The Google Cloud Storage URI that stores the system instruction, starting with gs://.
  *   `temperature` (*type:* `number()`, *default:* `nil`) - Temperature value used for sampling set when the dataset was saved. This value is used to tune the degree of randomness.
  *   `text` (*type:* `String.t`, *default:* `nil`) - The content of the prompt dataset.
  *   `topK` (*type:* `String.t`, *default:* `nil`) - Top K value set when the dataset was saved. This value determines how many candidates with highest probability from the vocab would be selected for each decoding step.
  *   `topP` (*type:* `number()`, *default:* `nil`) - Top P value set when the dataset was saved. Given topK tokens for decoding, top candidates will be selected until the sum of their probabilities is topP.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :candidateCount => String.t() | nil,
          :gcsUri => String.t() | nil,
          :groundingConfig =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPredictParamsGroundingConfig.t()
            | nil,
          :hasPromptVariable => boolean() | nil,
          :logprobs => boolean() | nil,
          :maxOutputTokens => String.t() | nil,
          :note => String.t() | nil,
          :promptApiSchema =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPromptApiSchema.t() | nil,
          :promptType => String.t() | nil,
          :seedEnabled => boolean() | nil,
          :seedValue => String.t() | nil,
          :stopSequences => list(String.t()) | nil,
          :systemInstruction => String.t() | nil,
          :systemInstructionGcsUri => String.t() | nil,
          :temperature => number() | nil,
          :text => String.t() | nil,
          :topK => String.t() | nil,
          :topP => number() | nil
        }

  field(:candidateCount)
  field(:gcsUri)

  field(:groundingConfig,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPredictParamsGroundingConfig
  )

  field(:hasPromptVariable)
  field(:logprobs)
  field(:maxOutputTokens)
  field(:note)

  field(:promptApiSchema,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaPromptApiSchema
  )

  field(:promptType)
  field(:seedEnabled)
  field(:seedValue)
  field(:stopSequences, type: :list)
  field(:systemInstruction)
  field(:systemInstructionGcsUri)
  field(:temperature)
  field(:text)
  field(:topK)
  field(:topP)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTextPromptDatasetMetadata do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTextPromptDatasetMetadata.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaTextPromptDatasetMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
